angular.module('main').controller(
		'deviceListCtrl',
		[
				'$scope',
				'NgTableParams',
				function($scope, NgTableParams) {
					$scope.title="设备信息";
					$scope.findData = [ {
						'name' : '设备名称:',
						'type' : '0'
					}, {
						'name' : '',
						'type' : '1'
					}, {
						'name' : '生产商:',
						'type' : '0'
					}, {
						'name' : '',
						'type' : '1'
					}, {
						'name' : 'IP地址:',
						'type' : '0'
					}, {
						'name' : '',
						'type' : '1'
					}, {
						'name' : '端口:',
						'type' : '0'
					}, {
						'name' : '',
						'type' : '1'
					}, {
						'name' : '注册时间:',
						'type' : '0'
					}, {
						'name' : '',
						'type' : '1'
					} ];
					var data = [ {
						name : "T1",
						producer : "珠海伟思",
						ip : "192.168.0.165",
						port : "8080",
						create : "2016-5-8"
					}, {
						name : "T2",
						producer : "珠海伟思",
						ip : "192.168.0.165",
						port : "8080",
						create : "2016-5-8"
					}, {
						name : "T3",
						producer : "珠海伟思",
						ip : "192.168.0.165",
						port : "8080",
						create : "2016-5-8"
					}, {
						name : "T4",
						producer : "珠海伟思",
						ip : "192.168.0.165",
						port : "8080",
						create : "2016-5-8"
					}, {
						name : "T5",
						producer : "珠海伟思",
						ip : "192.168.0.165",
						port : "8080",
						create : "2016-5-8"
					}, {
						name : "T6",
						producer : "珠海伟思",
						ip : "192.168.0.165",
						port : "8080",
						create : "2016-5-8"
					}, {
						name : "T7",
						producer : "珠海伟思",
						ip : "192.168.0.165",
						port : "8080",
						create : "2016-5-8"
					}, {
						name : "T8",
						producer : "珠海伟思",
						ip : "192.168.0.165",
						port : "8080",
						create : "2016-5-8"
					}, {
						name : "T9",
						producer : "珠海伟思",
						ip : "192.168.0.165",
						port : "8080",
						create : "2016-5-8"
					}, {
						name : "T10",
						producer : "珠海伟思",
						ip : "192.168.0.165",
						port : "8080",
						create : "2016-5-8"
					}, {
						name : "T11",
						producer : "珠海伟思",
						ip : "192.168.0.165",
						port : "8080",
						create : "2016-5-8"
					}, {
						name : "T12",
						producer : "珠海伟思",
						ip : "192.168.0.165",
						port : "8080",
						create : "2016-5-8"
					}, {
						name : "T13",
						producer : "珠海伟思",
						ip : "192.168.0.165",
						port : "8080",
						create : "2016-5-8"
					}, {
						name : "T14",
						producer : "珠海伟思",
						ip : "192.168.0.165",
						port : "8080",
						create : "2016-5-8"
					}, {
						name : "T15",
						producer : "珠海伟思",
						ip : "192.168.0.165",
						port : "8080",
						create : "2016-5-8"
					}, {
						name : "T16",
						producer : "珠海伟思",
						ip : "192.168.0.165",
						port : "8080",
						create : "2016-5-8"
					}, {
						name : "T17",
						producer : "珠海伟思",
						ip : "192.168.0.165",
						port : "8080",
						create : "2016-5-8"
					} ];

					var rightData = {
						'selected' : -1,
						'message' : [ {
							'click' : false,
							'value' : '内端',
							'position' : 0,
							'hasItem' : true,
							'message' : [ {
								'value' : '配置服务'
							}, {
								'value' : '配置数据源'
							} ]
						}, {
							'click' : false,
							'value' : '外端',
							'position' : 1,
							'hasItem' : false,
							'message' : []
						} ]
					};
					$scope.rightData = rightData;

					$scope.tableParams = new NgTableParams({
						page : 1, // show first page
						count : 10
					// count per page
					}, {
						total : data.length, // length of data
						getData : function($defer, params) {
							$defer.resolve(data.slice((params.page() - 1)
									* params.count(), params.page()
									* params.count()));
						}
					});
				} ])